#ifndef EMOJIDELEGATE_H
#define EMOJIDELEGATE_H

#include <QAbstractItemDelegate>
#include <QCache>

class EmojiDelegate : public QAbstractItemDelegate
{
public:
    explicit EmojiDelegate(QObject *parent = nullptr);

    // QAbstractItemDelegate interface
public:
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;

private:
    mutable QCache<QString, QImage> m_imageCache; // 缓存机制

};

#endif // EMOJIDELEGATE_H
